#include "filemmap.h"
#include <string>
#include <iostream>
#include <time.h>
#include <sys/time.h>

int main()
{
    fileMmap f("./test.txt", 0666);
    std::string s, t;
    t = "xxhhdzl";
    //f.clear();
    for (ll i = 0; i < 100000000; i++)
    {
        s += 'x';
    }
    //f.write(t);
    struct timeval tv, tv1;
    gettimeofday(&tv, NULL); 
    //time_t size = time(nullptr);
    f.write(s);
    gettimeofday(&tv1, NULL); 
    //int a = time(nullptr) - size;
    std::cout << tv1.tv_sec - tv.tv_sec << std::endl;
    std::cout << f.size() << std::endl;
    //f.clear();
    //std::cout << f.size() << std::endl;
    //f.write("嘻嘻哈哈的资料");
    //std::cout << f.read(0, 5000) << std::endl;
    return 0;
}